package com.cn.wanxi.servlet;

import com.cn.wanxi.model.CompanyModel;
import com.cn.wanxi.service.CompanyService;
import com.cn.wanxi.service.NavService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public class CommonServlet {
    public static void topAndNav(HttpServletRequest req) {
        CompanyService companyService = new CompanyService();
        CompanyModel companyModel = companyService.getCompanyModel();
        req.setAttribute("companyModel", companyModel);
//        req.setAttribute("net", net);
//        req.setAttribute("net", "112");
//导航数据,需要用一个容器来存储无数个对象?，引入数组，集合
//        数组？什么是数组？数组的表现形式
//        数组的定义？1.动态定义 2.静态定义
        NavService navService = new NavService();
//        NavModel[] navModels = navService.getNavModels();
        List<Object> navModelList = navService.getNavModelList();
        req.setAttribute("navModels", navModelList);
    }
}
